<?php
/*
 * @author: Nguyen Viet Manh
 * @email: manhnv85@gmail.com
 * @date: 03.03.2012
 */

//function get config web site
function get_info()
{
	$CI =& get_instance();
	$CI->load->model('config_model');
	return $CI->config_model->get_one_array();
}

//function get directory image
function get_dir_name($item_name = '')
{
	$CI =& get_instance();
	$dir_name	=	$CI->config->item('name_dir_upload');
	return $dir_name.($item_name == '' ? '' : '/'.$item_name ).'/';
}
//function get directory image

//function get image 
function get_image_url($img_name = '',$dir = '', $size = '60-40')
{
	if($size){
		return get_dir_name($dir).'thumb_'.$size.'/'.$img_name;
	}else
	{
		return get_dir_name($dir).$img_name;
	}
}
//function get image

//function convert from object to array
function convert_object_array($object = null)
{
	$array = array();
    foreach($object as $k => $v)
    {
    	$array[$k]=$v;
    }
    return $array;
}
//function convert from object to array
